home *** CD-ROM | disk | FTP | other *** search
/ Champak 139 / (Vol 139) Sep 24 2011.iso / Games / kirby.swf / scripts / DefineSprite_165 / frame_1 / PlaceObject2_143_1 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2011-09-24  |  2KB  |  56 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.Level[eval("../:Name")]._x + _root.Level._x >= - RandM && _root.Movwidth + RandM >= _root.Level[eval("../:Name")]._x + _root.Level._x && _root.Level[eval("../:Name")]._y + _root.Level._y >= - RandM && _root.Movheight + RandM >= _root.Level[eval("../:Name")]._y + _root.Level._y && _root.Kirby.AttackDemo == "off" && _root.Level[eval("../:Name")]._visible == 1 && eval("../:Name") != _root.Kirby.spiting)
  3.    {
  4.       Name = _root.Kirby.spiting.toLowerCase();
  5.       Name2 = eval("../:Name").toLowerCase();
  6.       if(this.Name != this.Name2)
  7.       {
  8.          _root.Level[eval("../:Name")]._y = StartY + 47 * Math.sin(0.017453292519943295 * rot);
  9.       }
  10.       rot += Speed * 2;
  11.       if(rot >= 360)
  12.       {
  13.          rot = 0;
  14.       }
  15.       _root.Level[eval("../:Name")]._x += X;
  16.       if(0 < X)
  17.       {
  18.          _root.Level[eval("../:Name")]._xscale = -100;
  19.       }
  20.       else
  21.       {
  22.          _root.Level[eval("../:Name")]._xscale = 100;
  23.       }
  24.       if(On != "off2")
  25.       {
  26.          On = "on";
  27.       }
  28.    }
  29.    else
  30.    {
  31.       if(On == "on" && _root.Level[eval("../:Name")]._visible == 0)
  32.       {
  33.          duplicateMovieClip(_root.Level.Puffeffect,"Peffect1",16584);
  34.          _root.Level.Peffect1._x = _root.Level[eval("../:Name")]._x;
  35.          _root.Level.Peffect1._y = _root.Level[eval("../:Name")]._y - 10;
  36.       }
  37.       On = "off";
  38.       if(- RandL >= StartX + _root.Level._x || StartX + _root.Level._x >= _root.Movwidth + RandL || - RandL >= StartY + _root.Level._y || StartY + _root.Level._y >= _root.Movheight + RandL)
  39.       {
  40.          _root.Level[eval("../:Name")]._visible = 1;
  41.          _root.Level[eval("../:Name")]._x = StartX;
  42.          _root.Level[eval("../:Name")]._y = StartY;
  43.          if(_root.Level[eval("../:Name")]._x + _root.Level._x < _root.Kirby._x)
  44.          {
  45.             _root.Level[eval("../:Name")]._xscale = -100;
  46.             X = Speed;
  47.          }
  48.          else
  49.          {
  50.             X = - Speed;
  51.             _root.Level[eval("../:Name")]._xscale = 100;
  52.          }
  53.       }
  54.    }
  55. }
  56.